package com.xspace.android.imcommon.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class PushMsgBody {
	/** 标题 */
	private String title = "";
	/** 图片 */
	private String img = "";
	/** 链接地址 */
	private String src = "";
	/** �?�� */
	private String summary = "";

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	/**
	 * 
	 * @Description: 解析推�?消息�?
	 * @param @param body
	 * @param @return
	 * @return
	 * @throws
	 */
	public static List<PushMsgBody> parsePushMsgBodys(String body) {
		ArrayList<PushMsgBody> list = new ArrayList<PushMsgBody>();
		try {
			JSONObject jo = new JSONObject(body);
			Gson mGson = new Gson();
			list = (mGson.fromJson(jo.getString("newssnap"),
					new TypeToken<ArrayList<PushMsgBody>>() {
					}.getType()));
		} catch (Exception e) {

		}
		return list;
	}
}
